package io.renren.modules.book.mq;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Receiver {

    @RabbitListener(bindings = @QueueBinding(
            exchange = @Exchange(RabbitConfig.EXCHANGE_DIRECT_HUANG),
            value = @Queue(RabbitConfig.QUEUE_1)
    ))
    public void recv2(String msg) {
        System.out.println(" received : " + msg + "!");
    }
}
